#ifndef UGAME_EVENT_HANDLER
#define UGAME_EVENT_HANDLER

#include "cocos2d.h"
#include "../../platform/UGCustomMacros.h"
#include "UGEvent.h"

USING_NS_CC;

namespace ugame {
    typedef void (CCObject::*UGHandlerFunc)(UGEvent*);    
    #define ug_handler_func(_SELECTOR) (UGHandlerFunc)(&_SELECTOR)
    
    class UGEventHandler : public Ref{
        UG_PROPERTY_GETTER(int, eventId, EventId);
        UG_PROPERTY_GETTER(int, eventType, EventType);
        UG_PROPERTY_GETTER(int, order, Order);
        UG_PROPERTY_GETTER(Ref*, handlerObj, HandlerObj);
        UG_PROPERTY_GETTER(UGHandlerFunc, handlerFunc, HandlerFunc);       
    public:
        UGEventHandler();
        virtual ~UGEventHandler();
    };
}

#endif 
